<?php session_start();

require_once("../config/sohu_config.php");
require_once("SohuOAuth.php");

function sohu_login()
{
	$_SESSION['callback_count'] = 1;

	$oauth_obj = new SohuOAuth(CONSUMER_KEY, CONSUMER_SECRET);
	$request_token = $oauth_obj->getRequestToken(OAUTH_CALLBACK);
	
	$_SESSION['request_token'] = $request_token;
	
	if (200 == $oauth_obj->http_code)
	{
		$login_url = $oauth_obj->getAuthorizeUrl1($request_token['oauth_token'], OAUTH_CALLBACK);
		header("Location:".$login_url);
	}
}

sohu_login();
?>